<?php

/**
 * PublicUser filter form base class.
 *
 * @package    jobeet
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BasePublicUserFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'name'        => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'first_name'  => new sfWidgetFormFilterInput(),
      'last_name'   => new sfWidgetFormFilterInput(),
      'birth_year'  => new sfWidgetFormFilterInput(),
      'birth_month' => new sfWidgetFormFilterInput(),
      'birth_day'   => new sfWidgetFormFilterInput(),
      'email'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'currency'    => new sfWidgetFormFilterInput(),
      'login'       => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'password'    => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'phone'       => new sfWidgetFormFilterInput(),
      'mobile'      => new sfWidgetFormFilterInput(),
      'address1'    => new sfWidgetFormFilterInput(),
      'address2'    => new sfWidgetFormFilterInput(),
      'city'        => new sfWidgetFormFilterInput(),
      'state'       => new sfWidgetFormFilterInput(),
      'country'     => new sfWidgetFormFilterInput(),
      'zip'         => new sfWidgetFormFilterInput(),
      'newslist'    => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'name'        => new sfValidatorPass(array('required' => false)),
      'first_name'  => new sfValidatorPass(array('required' => false)),
      'last_name'   => new sfValidatorPass(array('required' => false)),
      'birth_year'  => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'birth_month' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'birth_day'   => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'email'       => new sfValidatorPass(array('required' => false)),
      'currency'    => new sfValidatorPass(array('required' => false)),
      'login'       => new sfValidatorPass(array('required' => false)),
      'password'    => new sfValidatorPass(array('required' => false)),
      'phone'       => new sfValidatorPass(array('required' => false)),
      'mobile'      => new sfValidatorPass(array('required' => false)),
      'address1'    => new sfValidatorPass(array('required' => false)),
      'address2'    => new sfValidatorPass(array('required' => false)),
      'city'        => new sfValidatorPass(array('required' => false)),
      'state'       => new sfValidatorPass(array('required' => false)),
      'country'     => new sfValidatorPass(array('required' => false)),
      'zip'         => new sfValidatorPass(array('required' => false)),
      'newslist'    => new sfValidatorPass(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('public_user_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'PublicUser';
  }

  public function getFields()
  {
    return array(
      'id'          => 'Number',
      'name'        => 'Text',
      'first_name'  => 'Text',
      'last_name'   => 'Text',
      'birth_year'  => 'Number',
      'birth_month' => 'Number',
      'birth_day'   => 'Number',
      'email'       => 'Text',
      'currency'    => 'Text',
      'login'       => 'Text',
      'password'    => 'Text',
      'phone'       => 'Text',
      'mobile'      => 'Text',
      'address1'    => 'Text',
      'address2'    => 'Text',
      'city'        => 'Text',
      'state'       => 'Text',
      'country'     => 'Text',
      'zip'         => 'Text',
      'newslist'    => 'Text',
    );
  }
}
